<!--<?php 
print <<<EOT
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" id="html">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>楼盘地图搜索- {$house_sitename} - Powered by PHPWind</title>
<meta name="generator" content="PHPWind $wind_version" />
<meta name="description" content="{$house_sitename} 电子地图，楼市地图，楼盘地图，新房地图，房产地图" />
<meta name="keywords" content="{$house_sitename} 电子地图，楼市地图，楼盘地图，新房地图，房产地图" />
<meta http-equiv="x-ua-compatible" content="ie=7" />
<link rel='archives' title='$db_bbsname' href='$db_bbsurl/simple' />
<base id="headbase" href="$db_bbsurl/" />

<link rel="stylesheet" type="text/css" href="$imgpath/pw_core.css" />
<link rel="stylesheet" type="text/css" href="mode/house/images/head.css" />
<link rel="stylesheet" type="text/css" href="mode/house/images/style.css" />

<script src="js/core/core.js" language="JavaScript" type="text/javascript"></script>
<script src="js/pw_ajax.js" language="JavaScript" type="text/javascript"></script>
<script src="js/date.js" language="JavaScript" type="text/javascript"></script>
<script type="text/javascript" src="mode/house/js/jquery-1.4.min.js"></script>
<script type="text/javascript" src="mode/house/js/pw-hcommon.js"></script>
<script type="text/javascript" src="mode/house/js/housemap-utility.js"></script>
<script type="text/javascript" src="mode/house/js/housemap.js"></script>
<script type="text/javascript" src="mode/house/js/housemap_info.js"></script>
<script type="text/javascript" src="mode/house/js/housemap-keywordsearch.js"></script>
<script language="JavaScript">
var imgpath = '$imgpath';
var verifyhash = '$verifyhash';
var modeimg = '$pwModeImg';
var modeBase = '$baseUrl';
var winduid = '$winduid';
var windid	= '$windid';
var groupid	= '$groupid';
var basename = '$basename';
var temp_basename = '$temp_basename';
</script>
<script>
jQuery(function(){
	/*-------搜索框--------*/
	jQueryq=jQuery("#q");
	if(jQueryq.val())jQueryq.css("color","#898989");
	jQueryq.focus(function(){
		if(jQuery(this).val()==jQuery(this)[0].defaultValue)jQuery(this).val("");
		jQuery(this).css("color","");
	}).blur(function(){
		if(!jQuery(this).val()||jQuery(this).val()==jQuery(this)[0].defaultValue){
			jQuery(this).css("color","#898989");
			jQuery(this).val(jQuery(this)[0].defaultValue);
		}
	})
	
	/*----筛选条件--手风琴-------*/
	jQuery(".filter-list>.item>a").click(function(){
		var p=jQuery(this).parent();
		if(p.is(".open"))return;
		p.siblings(".open").removeClass("open").addClass("close");
		p.removeClass("close").addClass("open");
		return false;
	})
	
	/*-----右侧边卡盘--------*/
	pw_tab("extra","click")
});

function  showHouseMap(){
	var mapPointObj = new mapPoint();
	mapPointObj.mapPane = "map_main";
	mapPointObj.showTip = "false";
	mapPointObj.showPointDelay = true;
	mapInit(mapPointObj);
	setMapAutoHeight();
	setSearchConditions('','','',1);
}
function showSearchPoints(){
	/*清理之前的搜索结果*/
	if(mapObj != null && mapObj != 'undefined'){
		mapObj.removeAllOverlays();
	}else{
		showDialog('error','地图加载失败',2);
	}
	if (this.request.responseText != '') {
		var result = this.request.responseText;
		result = parent.JSONParse(result);
		mapSearcherObj.searchResultShowInner = true;
		if (result['type'] == 'history') {
			mapSearcherObj.resultPane = "search_result_content_history";
		} else {
			mapSearcherObj.resultPane = "search_result_content";
		}
		mapSearcherObj.showSearchResultList1(result['contents']);
		if(result['pages'] != '' && result['pages'] != 'undefined'){
			document.getElementById("search_result_pages").innerHTML = result['pages'];
		}
	}
}
function setSearchType(type){
	var currentType = document.getElementById("currentType");
	currentType.value = type;
}
var searchConditions = {};
var searchConditionsKeys = ['area','paystatus','aveprice','status','buildtype','property'];
function setSearchConditions(key,value,ifPush,type,page){
	if (key != '' && key != 'undefined' && value != '' && value != 'undefined') {
		if (typeof searchConditions[key] != 'object') {
			searchConditions[key] = new Array();
		}
		var searchCondition = searchConditions[key];
		if (ifPush) {
			searchCondition.push(value);
		} else {
			for(var index=0; index<searchCondition.length; index++) {
				if (searchCondition[index] == value) {
					searchCondition.splice(index,1);
				}
			}
		}
		searchConditions[key] = searchCondition;
	}
	var currentTypeObj = document.getElementById("currentType");
	var currentType = currentTypeObj.value;
	var url = "mode.php?m=house&q=housemap&hid=$hid&step=search&type="+currentType+"&page="+page;
	createFormTable(url);
}
function createFormTable(actionUrl){
	var formObj = document.createElement('form');
	formObj.action = actionUrl;
	formObj.name = 'searchHouse';
	formObj.method = 'post';
	for(var i=0; i<searchConditionsKeys.length; i++) {
		if (searchConditionsKeys[i] in searchConditions) {
			var objName = searchConditionsKeys[i];
			var objValues = searchConditions[objName];
			for(var k=0; k<objValues.length; k++) {
				var inputObj = document.createElement('input');
				inputObj.value = objValues[k];
				inputObj.type = 'hidden';
				inputObj.name = objName + '[]';
				formObj.appendChild(inputObj);
			}
		}
	}
	/*添加排序部分*/
	var order = document.getElementById("houseOrder");
	var inputObj = document.createElement('input');
	inputObj.value = order.value;
	inputObj.type = 'hidden';
	inputObj.name = 'order';
	formObj.appendChild(inputObj);
	
	/* 添加入住时间 starttime_1 */
	var starttime_1 = document.getElementById("starttime_1");
	if(starttime_1 != null && starttime_1 != 'undefined' && starttime_1.value != ''){
		var inputObj = document.createElement('input');
		inputObj.value = starttime_1.value;
		inputObj.type = 'hidden';
		inputObj.name = "deliverdate[start]";
		formObj.appendChild(inputObj);
	}
	/* endtime_1 */
	var endtime_1 = document.getElementById("endtime_1");
	if(endtime_1 != null && endtime_1 != 'undefined' && endtime_1.value != ''){
		var inputObj = document.createElement('input');
		inputObj.value = endtime_1.value;
		inputObj.type = 'hidden';
		inputObj.name = "deliverdate[end]";
		formObj.appendChild(inputObj);
	}
	
	/* 添加开盘时间 starttime_2 */
	var starttime_2 = document.getElementById("starttime_2");
	if(starttime_2 != null && starttime_2 != 'undefined' && starttime_2.value != ''){
		var inputObj = document.createElement('input');
		inputObj.value = starttime_2.value;
		inputObj.type = 'hidden';
		inputObj.name = "opendate[start]";
		formObj.appendChild(inputObj);
	}
	/* endtime_2 */
	var endtime_2 = document.getElementById("endtime_2");
	if(endtime_2 != null && endtime_2 != 'undefined' && endtime_2.value != ''){
		var inputObj = document.createElement('input');
		inputObj.value = endtime_2.value;
		inputObj.type = 'hidden';
		inputObj.name = "opendate[end]";
		formObj.appendChild(inputObj);
	}
	document.body.appendChild(formObj);
	ajax.submit(formObj,showSearchPoints);
}
function setMapAutoHeight(){
	var h = getWindowHeight();
	var mapPaneObj = document.getElementById("map_main");
	var tabObj_1 = document.getElementById("tab-panel-1");
	var tabObj_2 = document.getElementById("tab-panel-2");
	var filterObj = document.getElementById("filter_bd");
	var filterObjs = filterObj.getElementsByTagName('div');
	var mapH = (h - 170);
	mapPaneObj.style.height = mapH < 200 ? '200px' : mapH + "px";
	filterObj.style.height = (mapH + 25)+'px';
	tabObj_2.style.height = tabObj_1.style.height = (mapH + 35) + 'px';
	var filterPaneHeight = (mapH + 25) - (9 * 27);
	for(var i=0; i<filterObjs.length; i++) {
		if (filterObjs[i].className == 'filter-list-auto') {
			filterObjs[i].style.height = filterPaneHeight + 'px';
		}
	}
}
</script>
</head>
<body id="map" onload="showHouseMap()" onresize="setMapAutoHeight()">
<!--#include printEOT('headbar');#-->
<div id="pw-house">
<input type="hidden" name="currentType" value="f" id="currentType"/>
	<div id="header" class="cc mb10">
		<h1 id="logo"><img src="mode/house/images/logo-emap.gif" alt="地图搜索_phpwind 让网站更具价值" /></h1>
		<div id="nav-global">
			<b class="l"></b>
			<ul>
<!--#
foreach ($_Navbar['main'] as $key => $value) {
	if ($key == 'html') continue;
	$currentClass = $value['data']['iscurrent'] ? 'class="current"' : '';
	$html = buildNavLinkHtml($value['data']);
#-->
<li $currentClass>$html</li>
<!--#
}
#-->
			</ul>
			<b class="r"></b>
		</div>
		<!--
EOT;
if ($showEmptyNav) {
print <<<EOT
-->

			<div id="sub-nav-global">
                <b class="l"></b>
				<div class="navBbg">
				</div>
                <b class="r"></b>
            </div>
<!--
EOT;
}
print <<<EOT
-->

	</div>
	<div id="main" class="cc">
		<div class="w-sub">
			<div id="filter" class="pw-hbox">
				<div class="hd">
					<h3>筛选搜索</h3>
				</div>
				<div class="bd" id="filter_bd">
					<ul class="filter-list">
						<li class="item close"><a href="javascript:;">所属城区</a>
							<div class="filter-list-auto">
							<ul>
<!--
EOT;
foreach((array)$areaField as $key => $value){
print <<<EOT
-->
								<li><label><input type="checkbox" onclick="setSearchConditions('area',this.value,this.checked,'f',1)" name="area[]" value="$key"/> $value</label></li>
<!--
EOT;
}print <<<EOT
-->
							</ul>
							</div>
						</li>
						<li class="item open"><a href="javascript:;">楼盘均价</a>
							<div class="filter-list-auto">
							<ul>
<!--
EOT;
foreach((array)$avepriceField as $key => $value){
print <<<EOT
-->
								<li><label><input type="checkbox" onclick="setSearchConditions('aveprice',this.value,this.checked,'f',1)" name="aveprice[]" value="$key"/> $value </label></li>
<!--
EOT;
}print <<<EOT
-->
							</ul>
							</div>
						</li>
						<li class="item close"><a href="javascript:;">销售状态</a>
							<div class="filter-list-auto">
							<ul>
<!--
EOT;
foreach((array)$buildStatus as $key => $value){
print <<<EOT
-->							
								<li><label><input type="checkbox" onclick="setSearchConditions('status',this.value,this.checked,'f',1)" name="status[]" value="$key"/> $value </label></li>
<!--
EOT;
}print <<<EOT
-->								
							</ul>
							</div>
						</li>
						<li class="item close"><a href="javascript:;">建筑形式</a>
							<div class="filter-list-auto">
							<ul>
<!--
EOT;
foreach((array)$buildTypeField as $key => $value){
print <<<EOT
-->
								<li><label><input type="checkbox" onclick="setSearchConditions('buildtype',this.value,this.checked,'f',1)" name="buildtype[]" value="$key"/> {$value}</label></li>
<!--
EOT;
}print <<<EOT
-->
							</ul>
							</div>
						</li>
						<li class="item close"><a href="javascript:;">楼盘类型</a>
							<div class="filter-list-auto">
							<ul>
<!--
EOT;
foreach((array)$propertyField as $key => $value){
print <<<EOT
-->
								<li><label><input type="checkbox" onclick="setSearchConditions('property',this.value,this.checked,'f',1)" name="property[]" value="$key"/> {$value}</label></li>
<!--
EOT;
}print <<<EOT
-->
							</ul>
							</div>
						</li>
						<li class="item close"><a href="javascript:;">装修状况</a>
							<div class="filter-list-auto">
							<ul>
<!--
EOT;
foreach((array)$fitmentField as $key => $value){
print <<<EOT
-->
								<li><label><input type="checkbox" onclick="setSearchConditions('paystatus',this.value,this.checked,'f',1)" name="paystatus[]" value="$key"/> $value </label></li>
<!--
EOT;
}print <<<EOT
-->
							</ul>
							</div>
						</li>
						<li class="item close"><a href="javascript:;">交付时间</a>
							<div class="filter-list-auto">
							<ul>
								<li style="padding-bottom: 8px;">开始：<input id="starttime_1" type="text" value="" name="" size="12" onclick="ShowCalendar(this.id,1)" onblur="setSearchConditions('','','','f',1)" onchange="setSearchConditions('','','','f',1)" /></li>
								<li style="padding-bottom: 8px;">结束：<input id="endtime_1" type="text" value="" name="" size="12" onclick="ShowCalendar(this.id,1)"  onblur="setSearchConditions('','','','f',1)" onchange="setSearchConditions('','','','f',1)" /></li>
							</ul>
							</div>
						</li>
						<li class="item close"><a href="javascript:;">开盘时间</a>
							<div class="filter-list-auto">
							<ul>
								<li style="padding-bottom: 8px;">开始：<input id="starttime_2" type="text" value="" name="" size="12" onclick="ShowCalendar(this.id,1)" onblur="setSearchConditions('','','','f',1)" onchange="setSearchConditions('','','','f',1)" /></li>
								<li style="padding-bottom: 8px;">结束：<input id="endtime_2" type="text" value="" name="" size="12" onclick="ShowCalendar(this.id,1)" onblur="setSearchConditions('','','','f',1)" onchange="setSearchConditions('','','','f',1)" /></li>
							</ul>
							</div>
						</li>
					</ul>
				</div>
			</div>
		</div>
		<div class="w-main">
			<div id="search" class="mb">
				<form id="search-form" method="post" action="mode.php?m=house&q=list">
					<label>楼盘搜索：</label>
					<input type="text" name="name" id="q" value="请输入楼盘名称" />
					<button id="q-btn" type="submit">搜索</button>
				</form>
				<div id="hot-keys">
					<dl>
						<dt>热门搜索：</dt>
						<dd>
<!--#
if ($house_hottag) {
foreach ($house_hottag as $key => $value) {
#-->
							<a href="{$value['url']}">{$value['name']}</a>&nbsp;
<!--# }} #-->
						</dd>
					</dl>
				</div>
			</div>
			<div id="map_main" style="width: 100%; height: 600px;"></div>
		</div>
		<div class="w-extra">
			<div id="extra" class="pw-hbox">
				<div class="hd">
					<ul class="tab-holder">
						<li class="current"><a href="javascript:;" onclick="setSearchType('f');setSearchConditions('','','','f',1)">搜索结果</a></li>
						<li><a href="javascript:;" onclick="setSearchType('history');setSearchConditions('','','','history',1);">浏览历史</a></li>
					</ul>
					<p class="options">
						<select id="houseOrder" onchange="setSearchConditions('','','','f',1)">
							<option value="0">楼盘升序</option>
							<option value="1">楼盘降序</option>
						</select>
					</p>
				</div>
				<div class="bd">
					<div class="tab-panel" id="tab-panel-1">
						<ul class="map-result-list" id="search_result_content"></ul>
						<div class="result-pages" id="search_result_pages">
						</div>
					</div>
					<div class="tab-panel hidden" id="tab-panel-2">
						<ul class="map-result-list" id="search_result_content_history"></ul>
					</div>
				</div>
			</div>
		</div>
		<div class="c"></div>
	</div>
</div>
</body>
</html>
<script language="JavaScript" src="js/global.js"></script>
<script type="text/javascript" src="http://app.mapabc.com/apis?&t=flashmap&v=2.3.2&key={$house_mapkey}"></script>
<!--
EOT;
$pos = strpos($GLOBALS['db_menuinit'],",");
if($pos == 0) $tmp = substr($GLOBALS['db_menuinit'],1,strlen($GLOBALS['db_menuinit']));
print <<<EOT
-->
<script language="JavaScript">
var openmenu = {{$tmp}};
read.InitMenu();
</script>
<!--
EOT;
?>-->